<?php

namespace pam\Factory;

/**
 * Description of SocialPolicyControllerFactory
 *
 * @author Robert Bwana
 */

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use pam\Controller\SocialPolicyController;


class SocialPolicyControllerFactory implements FactoryInterface{
    public function createService(ServiceLocatorInterface $serviceLocator) {
        $policyLocator = $serviceLocator->getServiceLocator();
        $socialPolicyService = $policyLocator->get('pam\Service\SocialPolicyService');
        $policyService = $policyLocator->get('pam\Service\PolicyService');
        $form = $policyLocator->get('FormElementManager')->get('pam\Form\SocialPolicyStatementForm');
        $policyForm = $policyLocator->get('FormElementManager')->get('pam\Form\PolicyForm');

        return new SocialPolicyController($socialPolicyService, $policyService, $form, $policyForm);
    }

}
